<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>{{ .Title }}</title>

	<link rel="stylesheet" id="theme-css" href="/static/css/github-markdown-css/dark.css">
	<link rel="stylesheet" href="/static/css/gitbook-theme/style.css">
	<link rel="stylesheet" href="/static/css/gitbook-theme/website.css">
	<link rel="stylesheet" href="/static/css/gitbook-theme/chapter-fold.css">
	<link rel="stylesheet" href="/static/css/gitbook-theme/splitter.css">
	<link rel="stylesheet" href="/static/css/highlight-theme/a11y-dark.css">
	<link rel="stylesheet" href="/static/css/highlightjs-copy.min.css">
	<link rel="stylesheet" href="/static/css/main.css">

	{{ if .Gitalk.ClientID }}
	<link rel="stylesheet" href="/static/css/gitalk/gitalk.css">
	{{end}}

	{{if .Analyzer.Baidu}}
	<!-- Baidu analytics -->
	<script>
		var _hmt = _hmt || [];
		(function() {
		  var hm = document.createElement("script");
		  hm.src = "https://hm.baidu.com/hm.js?{{.Analyzer.Baidu}}";
		  var s = document.getElementsByTagName("script")[0];
		  s.parentNode.insertBefore(hm, s);
		})();
	</script>
	{{end}}

	{{if .Analyzer.Google}}
	<!-- Google tag (gtag.js) -->
	<script async src="https://www.googletagmanager.com/gtag/js?id={{.Analyzer.Google}}"></script>
	<script>
		window.dataLayer = window.dataLayer || [];
		function gtag(){dataLayer.push(arguments);}
		gtag('js', new Date());

		gtag('config', '{{.Analyzer.Google}}');
	</script>
	{{end}}

</head>
<body>
	<div class="book font-size-2 font-family-1 color-theme-2">
		<div class="book-summary">
			<center>
				<p class="logo" role="logo"><a href="">{{ .Title }}</a></p>
			</center>
			<nav role="navigation">
				<ul class="summary">
					{{range .Nav}}
					{{ template "navs.html" .}}
					{{end}}
					<li class="divider"></li>
				</ul>
			</nav>
		</div>
		<div class="book-body">
			<div class="body-inner">
				{{ render "layouts/header.html" . }}
				<div class="page-wrapper" tabindex="-1" role="main">
					<div class="page-inner">
						<!-- Render the current template here -->
						{{ yield .}}
						<div id="gitalk"></div>
						<a href="#book-header" class="navigation-go-top"><i class="fa fa-arrow-up"></i></a>
					</div>
				</div>
				{{ render "layouts/footer.html" . }}
			</div>
		</div>
	</div>
</body>
<script src="/static/js/highlight.min.js"></script>
<script src="/static/js/highlightjs-copy.min.js"></script>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/chapter-fold.js"></script>
<script src="/static/js/splitter.js"></script>
<script src="/static/js/main.js"></script>
{{ if .Gitalk.ClientID }}
<script src="/static/js/gitalk.min.js"></script>
<script>
	const gitalk = new Gitalk({
		clientID: '{{.Gitalk.ClientID}}',
		clientSecret: '{{.Gitalk.ClientSecret}}',
		repo: '{{.Gitalk.Repo}}',
		owner: '{{.Gitalk.Owner}}',
		admin: ['{{.Gitalk.Owner}}'],
		id: '{{.Gitalk.Id}}',
		labels: ['gitalk']
	})

	gitalk.render('gitalk')
</script>
{{end}}

</html>

{{ define "navs.html" }}
<li class="chapter {{.Active}}">
	<a href="{{.Link}}">
		{{.ShowName}}
		{{if .IsDir}}<i class="exc-trigger fa"></i>{{end}}
	</a>
	{{if .Children}}
	<ul class="articles">
		{{range .Children}}
		{{ template "navs.html" . }}
		{{end}}
	</ul>
	{{end}}
</li>
{{end}}
